home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / rsxwdk2s.zip / RSXWDK / LIBSRC / DOS / DOS4300.C < prev    next >
C/C++ Source or Header  |  1994-12-17  |  477b  |  29 lines

  1. #include <errno.h>
  2. #include <sys/doscalls.h>
  3.  
  4.  
  5. /*
  6. ** AH = 0x43 ; AL = 0
  7. ** DS:DX name
  8. ** return CX: attr
  9. */
  10. int dos_getfattr(const char *name, int * attr)
  11. {
  12.     struct REGPACK r;
  13.     struct SEGPACK sr = { GetDS(), GetES()};
  14.  
  15.     r.eax = 0x4300;
  16.     SET_SEG_OFF(name, sr.ds, r.edx);
  17.  
  18.     _intxr(0x21, &r, &sr);
  19.  
  20.     if (r.eflags & 1) {
  21.     _sys_doserror2errno( r.eax & 0xFFFF);
  22.     return (-1);
  23.     }
  24.     else {
  25.     *attr = r.ecx & 0xFFFF;
  26.     return 0;
  27.     }
  28. }
  29.